<template>
  <div style="padding-top:30px;">
    <Table size="large" :columns="columns" :data="columns_data"></Table>
  </div>
</template>
<script>
  import expandStep from './expand-step.vue';
  import userRecruitApi from '../api/axios/userRecruitApi'

  //  process_state 表示完成了几项

  export default {
    components: { expandStep },
    data () {
      return {
        columns: [
          {
            type: 'expand',
            width: 50,
            render: (h, params) => {
              return h(expandStep, {
                props: {
                  row: params.row
                }
              })
            }
          },
          {
            title: '职位名称',
            key: 'job_name'
          },
          {
            title: '招聘类型',
            key: 'recruit_type'
          },
          {
            title: '内推',
            key: 'is_recommend'
          },
          {
            title: '应聘状态',
            key: 'recruit_state'
          },
          {
            title: '投递时间',
            key: 'deliver_time'
          }
        ],
        columns_data: [
          {
            job_name: 'Java 开发工程师',
            recruit_type: '校园',
            is_recommend: '是',
            recruit_state: '正在进行',
            deliver_time: '2017-07-03',
            is_success:'process',
            process_state: '4',
          },
          {
            job_name: '前端 开发工程师',
            recruit_type: '实习生',
            is_recommend: '否',
            recruit_state: '未通过',
            deliver_time: '2017-03-03',
            is_success:'error',
            process_state: '3',
          }
        ]
      }
    },
    computed: {
      getUserId (){
        return this.$store.getters['auth/getUserId'];
      }
    },
    methods: {

    },
    created() {
      let that = this;
      userRecruitApi.getJobRecordList({
        userId: that.getUserId
      },{
        success (res) {
          if (res.data.status === 200) {
            that.columns_data = res.data.data;

            that.$Message.success("获取成功");
          }else {
            that.$Message.error("获取失败");
            console.log("getJobRecordList 请求失败：" + res.data);
          }
        }
      });
    }
  }
</script>
<style>

</style>
